<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>【Linux操作系统】简学深悟启示录：Linux基本指令 | 澪贰</title><meta name="author" content="澪贰"><meta name="copyright" content="澪贰"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="ffffff"><meta name="description" content="本篇将开启Linux操作系统的全面学习，默认使用的是CentOS操作系统，使用Xshell进行远程登录服务器进行操作测试">
<meta property="og:type" content="article">
<meta property="og:title" content="【Linux操作系统】简学深悟启示录：Linux基本指令">
<meta property="og:url" content="http://example.com/2025/07/07/Linux/Linux%E5%9F%BA%E6%9C%AC%E6%8C%87%E4%BB%A4/index.html">
<meta property="og:site_name" content="澪贰">
<meta property="og:description" content="本篇将开启Linux操作系统的全面学习，默认使用的是CentOS操作系统，使用Xshell进行远程登录服务器进行操作测试">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250705182234.jpg">
<meta property="article:published_time" content="2025-07-07T12:31:51.000Z">
<meta property="article:modified_time" content="2025-07-07T12:56:30.000Z">
<meta property="article:author" content="澪贰">
<meta property="article:tag" content="Linux">
<meta property="article:tag" content="运维">
<meta property="article:tag" content="服务器">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250705182234.jpg"><script type="application/ld+json">{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "【Linux操作系统】简学深悟启示录：Linux基本指令",
  "url": "http://example.com/2025/07/07/Linux/Linux%E5%9F%BA%E6%9C%AC%E6%8C%87%E4%BB%A4/",
  "image": "https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250705182234.jpg",
  "datePublished": "2025-07-07T12:31:51.000Z",
  "dateModified": "2025-07-07T12:56:30.000Z",
  "author": [
    {
      "@type": "Person",
      "name": "澪贰",
      "url": "http://example.com/"
    }
  ]
}</script><link rel="shortcut icon" href="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/cat_icon.ico"><link rel="canonical" href="http://example.com/2025/07/07/Linux/Linux%E5%9F%BA%E6%9C%AC%E6%8C%87%E4%BB%A4/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>
    (() => {
      
    const saveToLocal = {
      set: (key, value, ttl) => {
        if (!ttl) return
        const expiry = Date.now() + ttl * 86400000
        localStorage.setItem(key, JSON.stringify({ value, expiry }))
      },
      get: key => {
        const itemStr = localStorage.getItem(key)
        if (!itemStr) return undefined
        const { value, expiry } = JSON.parse(itemStr)
        if (Date.now() > expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return value
      }
    }

    window.btf = {
      saveToLocal,
      getScript: (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        Object.entries(attr).forEach(([key, val]) => script.setAttribute(key, val))
        script.onload = script.onreadystatechange = () => {
          if (!script.readyState || /loaded|complete/.test(script.readyState)) resolve()
        }
        script.onerror = reject
        document.head.appendChild(script)
      }),
      getCSS: (url, id) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onload = link.onreadystatechange = () => {
          if (!link.readyState || /loaded|complete/.test(link.readyState)) resolve()
        }
        link.onerror = reject
        document.head.appendChild(link)
      }),
      addGlobalFn: (key, fn, name = false, parent = window) => {
        if (!true && key.startsWith('pjax')) return
        const globalFn = parent.globalFn || {}
        globalFn[key] = globalFn[key] || {}
        globalFn[key][name || Object.keys(globalFn[key]).length] = fn
        parent.globalFn = globalFn
      }
    }
  
      
      const activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      const activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', 'ffffff')
        }
      }

      btf.activateDarkMode = activateDarkMode
      btf.activateLightMode = activateLightMode

      const theme = saveToLocal.get('theme')
    
          const hour = new Date().getHours()
          const isNight = hour <= 6 || hour >= 18
          if (theme === undefined) isNight ? activateDarkMode() : activateLightMode()
          else theme === 'light' ? activateLightMode() : activateDarkMode()
        
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        document.documentElement.classList.toggle('hide-aside', asideStatus === 'hide')
      }
    
      
    const detectApple = () => {
      if (/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)) {
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
  
    })()
  </script><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":true,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"未找到符合您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":230,"highlightFullpage":false,"highlightMacStyle":false},
  copy: {
    success: '复制成功',
    error: '复制失败',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '天',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":150,"languages":{"author":"作者: 澪贰","link":"链接: ","source":"来源: 澪贰","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'medium_zoom',
  Snackbar: {"chs_to_cht":"已切换为繁体中文","cht_to_chs":"已切换为简体中文","day_to_night":"已切换为深色模式","night_to_day":"已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"top-right"},
  infinitegrid: {
    js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: false,
  islazyloadPlugin: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '【Linux操作系统】简学深悟启示录：Linux基本指令',
  isHighlightShrink: false,
  isToc: true,
  pageType: 'post'
}</script><link rel="stylesheet" href="/css/custom.css" media="defer" onload="this.media='all'"><script src="https://npm.elemecdn.com/echarts@4.9.0/dist/echarts.min.js"></script><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-double-row-display@1.00/cardlistpost.min.css"/>
<style>#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags:before {content:"\A";
  white-space: pre;}#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags > .article-meta__separator{display:none}</style>
<link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-categories-card@1.0.0/lib/categorybar.css"><link rel="stylesheet" href="https://unpkg.zhimg.com/hexo-butterfly-footer-beautify@1.0.0/lib/runtime.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiperstyle.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-wowjs/lib/animate.min.css" media="print" onload="this.media='screen'"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.3.0"></head><body><div id="web_bg" style="background-image: url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/water02.jpg);"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img text-center"><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/zero_two.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data text-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">96</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">74</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home-lg"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/comments/"><i class="fa-fw fas fa-envelope-open"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250705182234.jpg);"><nav id="nav"><span id="blog-info"><a class="nav-site-title" href="/"><span class="site-name">澪贰</span></a><a class="nav-page-title" href="/"><span class="site-name">【Linux操作系统】简学深悟启示录：Linux基本指令</span></a></span><div id="menus"><div id="search-button"><span class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></span></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home-lg"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/comments/"><i class="fa-fw fas fa-envelope-open"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><span class="site-page"><i class="fas fa-bars fa-fw"></i></span></div></div></nav><div id="post-info"><h1 class="post-title">【Linux操作系统】简学深悟启示录：Linux基本指令</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2025-07-07T12:31:51.000Z" title="发表于 2025-07-07 20:31:51">2025-07-07</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2025-07-07T12:56:30.000Z" title="更新于 2025-07-07 20:56:30">2025-07-07</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Linux/">Linux</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">总字数:</span><span class="word-count">5422</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>20分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title=""><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">浏览量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="container post-content" id="article-container"><div id="post-outdate-notice" data="{&quot;limitDay&quot;:365,&quot;messagePrev&quot;:&quot;It has been&quot;,&quot;messageNext&quot;:&quot;days since the last update, the content of the article may be outdated.&quot;,&quot;postUpdate&quot;:&quot;2025-07-07 20:56:30&quot;}" hidden></div><p>本篇将开启 <code>Linux</code> 操作系统的全面学习，默认使用的是 <code>CentOS</code> 操作系统，使用 <code>Xshell</code> 进行远程登录服务器进行操作测试</p>
<h1 id="什么是操作系统？"><a href="#什么是操作系统？" class="headerlink" title="什么是操作系统？"></a>什么是操作系统？</h1><p><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/6acb5bb684f042f694c705148f2b80ec.png" alt="在这里插入图片描述"></p>
<p>这是一个计算机系统层次结构的示意图，运行的过程是从上往下实现的，操作系统其实本质也是一种软件，是一种基础软件，对下提供软硬件资源的管理，对上提供稳定、快速、安全的操作环境，给予应用软件功能的支撑，因此所有的软件最终都会转化为硬件行为，都要经过操作系统的管理</p>
<h1 id="Xshell的使用"><a href="#Xshell的使用" class="headerlink" title="Xshell的使用"></a>Xshell的使用</h1><p><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/c95794e6bba548ef9dc5d5c4ab416651.png" alt="在这里插入图片描述"></p>
<p>目前更新的最新的是<a target="_blank" rel="noopener" href="https://www.xshell.com/zh/free-for-home-school/">Xshell8</a>，可以直接下载家庭学校的免费版本，能够满足基本的 <code>Linux</code> 学习，再就是需要自己购买一台轻量级云服务器进行登录使用</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[C:\~]$ ssh root@公网IP地址</span><br></pre></td></tr></table></figure>

<p>首先初始状态下只有一个主用户，即 <code>root</code>，输入 <code>ssh root@公网IP地址</code>，然后会弹出窗口让你输入密码，公网 <code>IP</code> 和密码都能在你购买服务器的地方找到</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">[C:\~]$ </span><br><span class="line"></span><br><span class="line">Connecting to 公网IP:22...</span><br><span class="line">Connection established.</span><br><span class="line">To escape to <span class="built_in">local</span> shell, press <span class="string">&#x27;Ctrl+Alt+]&#x27;</span>.</span><br><span class="line"></span><br><span class="line">WARNING! The remote SSH server rejected X11 forwarding request.</span><br><span class="line">Last failed login: Tue Jun 17 21:39:20 CST 2025 from 公网IP on ssh:notty</span><br><span class="line">There was 1 failed login attempt since the last successful login.</span><br><span class="line">Last login: Tue Jun 17 21:21:28 2025 from 公网IP</span><br><span class="line">	</span><br><span class="line">	Welcome to Huawei Cloud Service</span><br></pre></td></tr></table></figure>

<p>显示这一段说明就连接成功了，这个警告不用管，我使用的是华为云，可能会出现些许不兼容的情况，但是这不影响后续的学习，但是我们一般不使用主用户，<code>root</code> 操作记录混杂，出问题时难以定位责任；普通账户操作留痕，便于排查。所以一般创建普通用户来使用</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@hcss-ecs-6aa4 ~]# adduser 用户名</span><br></pre></td></tr></table></figure>

<p><code>adduser 用户名</code> 用于增加普通用户</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[root@hcss-ecs-6aa4 ~]# passwd 用户名</span><br><span class="line">Changing password <span class="keyword">for</span> user 用户名.</span><br><span class="line">New password: </span><br><span class="line">Retype new password: </span><br><span class="line">passwd: all authentication tokens updated successfully.</span><br></pre></td></tr></table></figure>
<p><code>passwd 用户名</code> 设置刚创立的普通用户的密码，一般输入的时候密码不回显</p>
<p>然后可以输入 <code>exit</code> 退出 <code>root</code> 账户（其实也能用命令直接切换，后面会讲），切换用户名即可登录普通用户账号</p>
<p>🔥<strong>值得注意的是：</strong> </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@hcss-ecs-6aa4 ~]# userdel -r 用户名</span><br></pre></td></tr></table></figure>

<p>由于 <code>root</code> 用户权限比普通用户高，所以只有在 <code>root</code> 用户下才能通过 <code>userdel -r 用户名</code> 来删除普通用户</p>
<h1 id="常用指令"><a href="#常用指令" class="headerlink" title="常用指令"></a>常用指令</h1><p><code>Linux</code> 通常都在后端运行，纯命令行能降低消耗，提高效率，因此一般不需要图形化界面，<code>指令一般都会搭配选项使用</code></p>
<h2 id="ls指令"><a href="#ls指令" class="headerlink" title="ls指令"></a>ls指令</h2><p><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/bc5ab53c450e4ef9bb2884aa7e5b29e7.png" alt="在这里插入图片描述"></p>
<p><code>ls</code> 的作用是列出该目录下的所有子目录与文件。对于文件，将列出文件名以及其他信息</p>
<p>在 <code>Linux</code> 中，目录指的就是我们平常创建的文件夹，蓝色的是目录，白色的是文件</p>
<ul>
<li><code>-a</code> 列出目录下的所有文件，包括以 <code>.</code> 开头的隐含文件</li>
<li><code>-d</code> 将目录象文件一样显示，而不是显示其下的文件。 如：<code>ls –d 指定目录</code></li>
<li><code>-i</code> 输出文件的 <code>i</code> 节点的索引信息。 如 <code>ls –ai</code> 指定文件</li>
<li><code>-k</code> 以 <code>k</code> 字节的形式表示文件的大小。<code>ls –alk</code> 指定文件</li>
<li><code>-l</code> 列出文件的详细信息</li>
<li><code>-n</code> 用数字的 <code>UID</code>、<code>GID</code> 代替名称（介绍 <code>UID</code>、<code>GID</code>）</li>
<li><code>-F</code> 在每个文件名后附上一个字符以说明该文件的类型，<code>*</code> 表示可执行的普通文件；<code>/</code> 表示目录；<code>@</code> 表示符号链接；<code>|</code> 表示 <code>FIFOs</code>；<code>=</code> 表示套接字( <code>sockets</code> )（目录类型识别）</li>
<li><code>-r</code> 对目录反向排序</li>
<li><code>-t</code> 以时间排序</li>
<li><code>-s</code> 在 <code>l</code> 文件名后输出该文件的大小（大小排序，如何找到目录下最大的文件）</li>
<li><code>-R</code> 列出所有子目录下的文件(递归) </li>
<li><code>-1</code> 一行只输出一个文件</li>
</ul>
<p>🔥<strong>值得注意的是：</strong> </p>
<p>常用的是 <code>-a</code>、<code>-l</code>、<code>-F</code>、<code>-d</code>，其他一般不怎么用</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ ll</span><br><span class="line">total 4</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test 4096 Jun 18 19:14 dir1</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test    0 Jun 17 23:23 text1</span><br></pre></td></tr></table></figure>

<p><code>ls -l</code> 可以缩写成 <code>ll</code></p>
<p><strong>第三行：</strong> 以 <code>d</code> 开头的表示目录<br><strong>第四行：</strong> 以 <code>-</code> 开头的表示普通文件</p>
<h2 id="pwd指令"><a href="#pwd指令" class="headerlink" title="pwd指令"></a>pwd指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">pwd</span></span><br><span class="line">/home/zzh_test</span><br></pre></td></tr></table></figure>

<p><code>pwd</code> 的作用是显示当前所在的路径，没有搭配的选项</p>
<h2 id="cd指令"><a href="#cd指令" class="headerlink" title="cd指令"></a>cd指令</h2><p><code>Linux</code> 任何一个目录下都有两个隐藏文件</p>
<ul>
<li><code>.</code>：表示当前路径</li>
<li><code>..</code>：表示上一级路径</li>
</ul>
<p>这两个文件都是为了帮助定位文件位置，即相对路径，平常见到的路径一般是绝对路径</p>
<p><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/9592f7b559574a2193de9c322d1fead4.png" alt="在这里插入图片描述"></p>
<p>所有的文件都是从根目录 <code>/</code> 开始的</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">ls</span></span><br><span class="line">dir1  text1</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">cd</span> dir1</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 dir1]$ <span class="built_in">pwd</span></span><br><span class="line">/home/zzh_test/dir1</span><br></pre></td></tr></table></figure>

<p>改变工作目录，将当前工作目录改变到指定的目录下</p>
<ul>
<li><code>cd ..</code>：返回上级目录</li>
<li><code>cd /home/litao/linux/</code>：绝对路径</li>
<li><code>cd ../day02/</code> ：相对路径</li>
<li><code>cd ~</code> ：进入用户家目录</li>
<li><code>cd -</code> ：返回最近访问目录</li>
</ul>
<h2 id="touch指令"><a href="#touch指令" class="headerlink" title="touch指令"></a>touch指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">touch</span> text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">ls</span></span><br><span class="line">dir1  text1  text2</span><br></pre></td></tr></table></figure>

<p><code>touch</code> 指令可更改文档或目录的相关属性，或者新建一个不存在的文件</p>
<ul>
<li><code>-a</code>   或 <code>--time=atime</code> 或 <code>--time=access</code> 或 <code>--time=use</code> 只更改存取时间</li>
<li><code>-c</code>   或 <code>--no-create</code>  不建立任何文档</li>
<li><code>-d</code>  使用指定的日期时间，而非现在的时间</li>
<li><code>-f</code>  此参数将忽略不予处理，仅负责解决 <code>BSD</code> 版本 <code>touch</code> 指令的兼容性问题</li>
<li><code>-m</code>   或 <code>--time=mtime</code> 或 <code>--time=modify</code> 只更改变动时间</li>
<li><code>-r</code>  把指定文档或目录的日期时间，统统设成和参考文档或目录的日期时间相同</li>
<li><code>-t</code>  使用指定的日期时间，而非现在的时间</li>
</ul>
<h2 id="mkdir指令"><a href="#mkdir指令" class="headerlink" title="mkdir指令"></a>mkdir指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">mkdir</span> -p dir1/dir2/dir3</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ tree</span><br><span class="line">.</span><br><span class="line">├── dir1</span><br><span class="line">│   └── dir2</span><br><span class="line">│       └── dir3</span><br><span class="line">├── text1</span><br><span class="line">└── text2</span><br><span class="line"></span><br><span class="line">3 directories, 2 files</span><br></pre></td></tr></table></figure>

<p><code>mkdir</code> 用于创建目录（文件夹）</p>
<p>🔥<strong>值得注意的是：</strong> </p>
<ul>
<li><code>-p</code> 一般用于递归式创建目录，普通创建就需要进入该级目录才能创建下一级目录，所以 <code>-p</code> 就方便了很多</li>
<li><code>tree</code> 指令用于展示树形结构的目录文件的层级关系，使用 <code>yum install -y tree</code> 指令下载即可使用</li>
</ul>
<h2 id="rmdir指令-rm指令"><a href="#rmdir指令-rm指令" class="headerlink" title="rmdir指令 &amp;&amp; rm指令"></a>rmdir指令 &amp;&amp; rm指令</h2><p><code>rmdir</code> 只能用来删除空目录</p>
<ul>
<li><code>-p</code> 当子目录被删除后如果父目录也变成空目录的话，就连带父目录一起删除</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ tree</span><br><span class="line">.</span><br><span class="line">├── dir1</span><br><span class="line">│   └── dir2</span><br><span class="line">│       └── dir3</span><br><span class="line">├── text1</span><br><span class="line">└── text2</span><br><span class="line"></span><br><span class="line">3 directories, 2 files</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">rm</span> -rfi dir1</span><br><span class="line"><span class="built_in">rm</span>: descend into directory ‘dir1’? y</span><br><span class="line"><span class="built_in">rm</span>: descend into directory ‘dir1/dir2’? y</span><br><span class="line"><span class="built_in">rm</span>: remove directory ‘dir1/dir2/dir3’? y</span><br><span class="line"><span class="built_in">rm</span>: remove directory ‘dir1/dir2’? y</span><br><span class="line"><span class="built_in">rm</span>: remove directory ‘dir1’? y</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ tree</span><br><span class="line">.</span><br><span class="line">├── text1</span><br><span class="line">└── text2</span><br><span class="line"></span><br><span class="line">0 directories, 2 files</span><br></pre></td></tr></table></figure>
<p><code>rmdir</code> 还是太鸡肋了，所以更多使用 <code>rm</code>，能够删除文件或目录</p>
<ul>
<li><code>-f</code> 即使文件属性为只读(即写保护)，亦直接强制删除</li>
<li><code>-i</code> 删除前逐一询问确认</li>
<li><code>-r</code> 删除目录及其下所有文件(递归删除)</li>
</ul>
<h2 id="man指令"><a href="#man指令" class="headerlink" title="man指令"></a>man指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ man man</span><br></pre></td></tr></table></figure>
<p><code>man</code> 指令用于查看指令手册，毕竟不可能记住所有的指令，<code>man man</code> 是查询 <code>man</code> 这条指令的意思</p>
<ul>
<li><code>-k</code>：根据关键字搜索联机帮助</li>
<li><code>num</code>：<code>man num printf</code> 只在第 <code>num</code> 章节找，比如 <code>printf</code> 在第一章是一个命令，但是在第三章是一个函数，有可能你的系统没有安装相应手册文件，可执行 <code>yum install man-pages</code>，就能查找函数了</li>
<li><code>-a</code>：将所有章节的都显示出来，比如 <code>man printf</code> 它缺省从第一章开始搜索，知道就停止，用 <code>a</code> 选项，当按下 <code>q</code> 退出，他会继续往后面搜索，直到所有章节都搜索完毕</li>
</ul>
<p><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/4ea470ff8b044fb1a4ac9382fdc3e025.png" alt="在这里插入图片描述"></p>
<h2 id="cp指令"><a href="#cp指令" class="headerlink" title="cp指令"></a>cp指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">ls</span></span><br><span class="line">text1  text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">cp</span> text1 new_test</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">ls</span></span><br><span class="line">new_test  text1  text2</span><br></pre></td></tr></table></figure>

<p><code>cp</code> 指令的作用是将已存在的文件或目录，复制到新文件（若文件不存在会自行创建）或目录中</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cp</span> 源文件1 源文件2 源文件3... 目标目录/</span><br></pre></td></tr></table></figure>

<p>同时指定两个以上的文件或目录，且最后的目的地是一个已经存在的目录，则它会把前面指定的所有文件或目录复制到此目录中。若同时指定多个文件或目录，而最后的目的地并非一个已存在的目录，则会出现错误信息</p>
<ul>
<li><code>-f</code> 或 <code>--force</code> 强行复制文件或目录， 不论目的文件或目录是否已经存在</li>
<li><code>-i</code> 或 <code>--interactive</code> 覆盖文件之前先询问用户</li>
<li><code>-r</code> 递归处理，将指定目录下的文件与子目录一并处理。若源文件或目录的形态，不属于目录或符号链接，则一律视为普通文件处理</li>
<li><code>-R</code> 或 <code>--recursive</code> 递归处理，将指定目录下的文件及子目录一并处理</li>
</ul>
<p>🔥<strong>值得注意的是：</strong> 同一目录下，不能出现同名文件</p>
<h2 id="mv指令"><a href="#mv指令" class="headerlink" title="mv指令"></a>mv指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 dir1]$ <span class="built_in">mv</span> a1 ../</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 dir1]$ <span class="built_in">mv</span> a1 text1</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 dir1]$ <span class="built_in">mv</span> a1 dir1</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 dir1]$ <span class="built_in">mv</span> a1 ../text1</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 dir1]$ <span class="built_in">mv</span> a1 ../dir1</span><br></pre></td></tr></table></figure>
<p><code>mv</code> 命令是 <code>move</code> 的缩写，可以用来 <code>移动文件</code> 或者 <code>将文件改名</code></p>
<p><strong>第一行：</strong> 表示将文件 <code>a1</code> 剪切到上级目录下<br><strong>第二行：</strong> 表示将文件 <code>a1</code> 剪切到当前路径的文件 <code>text1</code>，即重命名<br><strong>第三行：</strong> 表示将文件 <code>a1</code> 剪切到当前路径的目录 <code>dir1</code><br><strong>第四行：</strong> 表示将文件 <code>a1</code> 剪切到上级路径的文件 <code>text1</code>，即重命名<br><strong>第五行：</strong> 表示将文件 <code>a1</code> 剪切到上级路径的目录 <code>dir1</code></p>
<ul>
<li><code>-f</code>：<code>force</code> 强制的意思，如果目标文件已经存在，不会询问而直接覆盖</li>
<li><code>-i</code>：若目标文件已经存在时，就会询问是否覆盖</li>
</ul>
<h2 id="cat指令"><a href="#cat指令" class="headerlink" title="cat指令"></a>cat指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ tree</span><br><span class="line">.</span><br><span class="line">├── dir1</span><br><span class="line">│   ├── dir2</span><br><span class="line">│   │   └── dir3</span><br><span class="line">│   └── new_test</span><br><span class="line">├── my_dir</span><br><span class="line">│   ├── a1</span><br><span class="line">│   └── dir2</span><br><span class="line">│       └── dir3</span><br><span class="line">├── text1</span><br><span class="line">└── text2</span><br><span class="line"></span><br><span class="line">6 directories, 4 files</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">cat</span> dir1/new_test</span><br><span class="line">hello world!</span><br></pre></td></tr></table></figure>
<p><code>cat</code> 的作用是查看文件内容</p>
<ul>
<li><code>-b</code> 对非空行输出行编号</li>
<li><code>-n</code> 对输出的所有行编号</li>
<li><code>-s</code> 不输出多行空行，即将多行空行压缩成一行空行输出</li>
</ul>
<h2 id="echo指令（重定向）"><a href="#echo指令（重定向）" class="headerlink" title="echo指令（重定向）"></a>echo指令（重定向）</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ ll</span><br><span class="line">total 12</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test 4096 Jun 26 00:12 dir1</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test 4096 Jun 22 15:21 my_dir</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test   44 Jun 29 20:41 text1</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test    0 Jun 18 22:06 text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">echo</span> <span class="string">&quot;Hello Linux&quot;</span> &gt; text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">cat</span> text2</span><br><span class="line">Hello Linux</span><br></pre></td></tr></table></figure>

<p>在 <code>Linux</code> 中，一切的指令本质皆是可执行文件，指令也是在系统特定路径下存在的，本来正常情况下 <code>echo</code> 是向显示器打印出来给我们看的，但是加了 <code>&gt;</code> 表示 <code>输出重定向</code>，即将本来打印到显示器的文本重定向到具体文件中（若文件不存在会自动创建）</p>
<p>默认情况下，<code>echo</code> 会在输出末尾自动加换行符；若要取消，在 <code>Linux</code> 中可用 <code>echo -n &quot;文本&quot;</code>，例如 <code>echo -n &quot;Hi&quot;</code> 输出后不会换行</p>
<p>但是 <code>&gt;</code> 在写入的时候是覆盖式写入，即先清空文件再写入，如果想要追加可以使用 <code>&gt;&gt;</code>，同样的，像 <code>cat &gt; text1</code> 这样的，叫做 <code>输入重定向</code>，其实作用和 <code>cat text1</code> 没啥区别，他的区别在深入学习后会讲</p>
<p>通常能够打印信息到显示器的指令都能使用输出重定向，输入重定向同理</p>
<h2 id="more指令"><a href="#more指令" class="headerlink" title="more指令"></a>more指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ more Text</span><br><span class="line">hello Linux 1</span><br><span class="line">hello Linux 2</span><br><span class="line">hello Linux 3</span><br><span class="line">hello Linux 4</span><br><span class="line">hello Linux 5</span><br><span class="line">hello Linux 6</span><br><span class="line">hello Linux 7</span><br><span class="line">hello Linux 8</span><br><span class="line">hello Linux 9</span><br><span class="line">......</span><br></pre></td></tr></table></figure>
<p>当遇上大文本时，<code>cat</code> 的查看就不适合了，因为需要自行翻找内容特别麻烦，因此 <code>cat</code> 只适合查看小文本，这个时候就要使用 <code>more</code> 指令，查看的时候可以按 <code>ENTER</code> 键向下滚动翻找</p>
<ul>
<li><code>/字符串</code>：查找特定内容</li>
<li><code>q</code>：退出 <code>more</code></li>
</ul>
<h2 id="less指令"><a href="#less指令" class="headerlink" title="less指令"></a>less指令</h2><p><code>less</code> 与 <code>more</code> 类似，但使用 <code>less</code> 可以使用⬆️⬇️随意浏览文件，而 <code>more</code> 仅能向前移动，却不能向后移动，而且 <code>less</code> 在查看之前不会加载整个文件，只会加载你需要看的部分，加快了文件打开速度</p>
<ul>
<li><code>-i</code>：忽略搜索时的大小写</li>
<li><code>-N</code>：查看的时候，输入再按 <code>ENTER</code> 会显示每行的行号</li>
<li><code>-n</code>：隐藏输出的所有行编号</li>
<li><code>/字符串</code>：向下搜索“字符串”的功能</li>
<li><code>?字符串</code>：向上搜索“字符串”的功能</li>
<li><code>q</code>：退出 <code>less</code></li>
<li><code>n</code>：重复前一个搜索（与 <code>/</code> 或 <code>?</code> 有关）</li>
<li><code>N</code>：反向重复前一个搜索（与 <code>/</code> 或 <code>?</code> 有关）</li>
</ul>
<p>用 <code>/hello</code> 搜关键词 <code>hello</code> ，找到第 <code>3</code> 行的 <code>hello</code><br>按 <code>n</code> → 继续往下（正向）找下一个 <code>hello</code><br>按 <code>N</code> → 往回（反向）找之前的 <code>hello</code> </p>
<h2 id="head指令"><a href="#head指令" class="headerlink" title="head指令"></a>head指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">head</span> -5 Text</span><br><span class="line">hello Linux 1</span><br><span class="line">hello Linux 2</span><br><span class="line">hello Linux 3</span><br><span class="line">hello Linux 4</span><br><span class="line">hello Linux 5</span><br></pre></td></tr></table></figure>
<p><code>head</code> 用于捕捉大文本的前面的内容，若没有指定行数，<code>head</code> 默认查看前十行</p>
<ul>
<li><code>-n</code>：显示的行数</li>
</ul>
<h2 id="tail指令"><a href="#tail指令" class="headerlink" title="tail指令"></a>tail指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">tail</span> -5 Text</span><br><span class="line">hello Linux 996</span><br><span class="line">hello Linux 997</span><br><span class="line">hello Linux 998</span><br><span class="line">hello Linux 999</span><br><span class="line">hello Linux 1000</span><br></pre></td></tr></table></figure>

<p><code>tail</code> 用于捕捉大文本的结尾的内容，若没有指定行数，<code>tail</code> 默认查看后十行</p>
<ul>
<li><code>-f</code>：循环读取，执行后不会退出，而是持续监听文件变化，一旦文件有新内容添加（比如日志文件被写入新记录），会立即显示在屏幕上，直到手动按 <code>Ctrl + C</code> 终止</li>
<li><code>-n</code>：显示行数</li>
</ul>
<p>🔥<strong>值得注意的是：</strong> </p>
<p>有一个文件共有 <code>1000</code> 行内容，请取出第 <code>500-510</code> 行内容</p>
<ul>
<li>方法一</li>
</ul>
<ol>
<li><code>head -510 Text</code> 生成 <code>1</code> 到 <code>510</code> 的序列装入临时文件 <code>tmp</code></li>
<li><code>tail -11 tmp</code> 取出结尾 <code>500-510</code> 行的内容</li>
</ol>
<ul>
<li>方法二</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">head</span> -510 Text | <span class="built_in">tail</span> -11</span><br><span class="line">hello Linux 500</span><br><span class="line">hello Linux 501</span><br><span class="line">hello Linux 502</span><br><span class="line">hello Linux 503</span><br><span class="line">hello Linux 504</span><br><span class="line">hello Linux 505</span><br><span class="line">hello Linux 506</span><br><span class="line">hello Linux 507</span><br><span class="line">hello Linux 508</span><br><span class="line">hello Linux 509</span><br><span class="line">hello Linux 510</span><br></pre></td></tr></table></figure>

<p>利用管道文件的方法，像流水线一样快速处理多个指令，<code>|</code> 作用是将前一个命令 <code>head</code> 的输出作为后一个命令 <code>tail</code> 的输入</p>
<h2 id="date指令"><a href="#date指令" class="headerlink" title="date指令"></a>date指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">date</span> +%Y-%m-%d_%H:%M:%S</span><br><span class="line">2025-07-04_16:40:39</span><br></pre></td></tr></table></figure>

<p><code>data</code> 用于显示时间</p>
<ol>
<li>在显示方面，使用者可以设定欲显示的格式，格式设定为一个加号后接数个标记，其中常用的标记列表如下</li>
</ol>
<ul>
<li><code>%H</code>：小时(<code>00..23</code>) </li>
<li><code>%M</code>：分钟(<code>00..59</code>) </li>
<li><code>%S</code>：秒(<code>00..61</code>) </li>
<li><code>%X</code>：相当于 <code>%H:%M:%S</code> </li>
<li><code>%d</code>：日 (<code>01..31</code>) </li>
<li><code>%m</code>：月份 (<code>01..12</code>) </li>
<li><code>%Y</code>：完整年份 (<code>0000..9999</code>) </li>
<li><code>%F</code>：相当于 <code>%Y-%m-%d</code></li>
</ul>
<ol start="2">
<li>在设定时间方面</li>
</ol>
<ul>
<li><code>date -s</code> &#x2F;&#x2F;设置当前时间，只有 <code>root</code> 权限才能设置，其他只能查看。</li>
<li><code>date -s 20080523</code> &#x2F;&#x2F;设置成 <code>20080523</code>，这样会把具体时间设置成空 <code>00:00:00</code></li>
<li><code>date -s 01:01:01</code> &#x2F;&#x2F;设置具体时间，不会对日期做更改</li>
<li><code>date -s “01:01:01 2008-05-23″</code> &#x2F;&#x2F;这样可以设置全部时间</li>
<li><code>date -s “01:01:01 20080523″</code> &#x2F;&#x2F;这样可以设置全部时间</li>
<li><code>date -s “2008-05-23 01:01:01″</code> &#x2F;&#x2F;这样可以设置全部时间</li>
<li><code>date -s “20080523 01:01:01″</code> &#x2F;&#x2F;这样可以设置全部时间</li>
</ul>
<ol start="3">
<li>时间戳</li>
</ol>
<blockquote>
<p><strong>时间戳：</strong> 从 <code>1970</code> 年 <code>1</code> 月 <code>1</code> 日开始算的秒数，比如 <code>2025</code> 年 <code>7</code> 月 <code>4</code> 日对应的秒数是 <code>1751500800</code></p>
</blockquote>
<ul>
<li>时间-&gt;时间戳：<code>date +%s</code></li>
<li>时间戳-&gt;时间：<code>date -d@1508749502</code></li>
<li><code>Unix</code> 时间戳（英文为<code>Unix epoch</code>, <code>Unix time</code>, <code>POSIX time</code> 或 <code>Unix timestamp</code>）是从 <code>1970</code> 年<code>1</code> 月 <code>1</code> 日（<code>UTC</code> &#x2F; <code>GMT</code>的午夜）开始所经过的秒数，不考虑闰秒</li>
</ul>
<h2 id="cal指令"><a href="#cal指令" class="headerlink" title="cal指令"></a>cal指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ cal</span><br><span class="line">      July 2025     </span><br><span class="line">Su Mo Tu We Th Fr Sa</span><br><span class="line">       1  2  3  4  5</span><br><span class="line"> 6  7  8  9 10 11 12</span><br><span class="line">13 14 15 16 17 18 19</span><br><span class="line">20 21 22 23 24 25 26</span><br><span class="line">27 28 29 30 31</span><br></pre></td></tr></table></figure>

<p><code>cal</code> 命令可以用来显示公历（阳历）日历</p>
<ul>
<li><code>-3</code>：显示系统前一个月，当前月，下一个月的月历</li>
<li><code>-j</code>：显示在当年中的第几天（一年日期按天算，从 <code>1</code> 月 <code>1</code> 号算起，默认显示当前月在一年中的天数）</li>
<li><code>-y</code>：显示当前年份的日历，<code>cal –y 2018</code></li>
</ul>
<h2 id="find指令"><a href="#find指令" class="headerlink" title="find指令"></a>find指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ tree</span><br><span class="line">.</span><br><span class="line">├── dir1</span><br><span class="line">│   ├── dir2</span><br><span class="line">│   │   └── dir3</span><br><span class="line">│   └── new_test</span><br><span class="line">├── my_dir</span><br><span class="line">│   ├── a1</span><br><span class="line">│   └── dir2</span><br><span class="line">│       └── dir3</span><br><span class="line">├── Text</span><br><span class="line">├── text1</span><br><span class="line">└── text2</span><br><span class="line"></span><br><span class="line">6 directories, 5 files</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ find dir1</span><br><span class="line">dir1</span><br><span class="line">dir1/new_test</span><br><span class="line">dir1/dir2</span><br><span class="line">dir1/dir2/dir3</span><br></pre></td></tr></table></figure>

<p><code>find</code> 可以在磁盘中进行指定文件的搜索，在运行一个非常消耗资源的find命令时，很多人都倾向于把它放在后台执行，因为遍历一个大的文件系统可能会花费很长的时间(这里是指 <code>30G</code> 字节以上的文件系统)</p>
<p>🔥<strong>值得注意的是：</strong> 还有一些和find功能类似的指令</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">which</span> <span class="built_in">ls</span></span><br><span class="line"><span class="built_in">alias</span> <span class="built_in">ls</span>=<span class="string">&#x27;ls --color=auto&#x27;</span></span><br><span class="line">	/usr/bin/ls</span><br></pre></td></tr></table></figure>
<p><code>which</code>通常用于搜索指令的路径</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ whereis <span class="built_in">ls</span></span><br><span class="line"><span class="built_in">ls</span>: /usr/bin/ls /usr/share/man/man1p/ls.1p.gz /usr/share/man/man1/ls.1.gz</span><br></pre></td></tr></table></figure>

<p><code>whereis</code> 用于查找命令、源文件和手册页的位置</p>
<ul>
<li><code>which</code> 仅查找 <code>$PATH</code> 中的可执行文件；<code>whereis</code> 搜索范围更广，包括系统默认的多个目录，且能找到手册页、源码等</li>
<li><code>which</code> 更侧重 “命令在哪里可以执行”，<code>whereis</code> 更侧重 “与目标相关的所有系统文件在哪里”</li>
</ul>
<h2 id="grep指令"><a href="#grep指令" class="headerlink" title="grep指令"></a>grep指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ grep 99 Text</span><br><span class="line">hello Linux 99</span><br><span class="line">hello Linux 199</span><br><span class="line">hello Linux 299</span><br><span class="line">hello Linux 399</span><br><span class="line">hello Linux 499</span><br><span class="line">hello Linux 599</span><br><span class="line">hello Linux 699</span><br><span class="line">hello Linux 799</span><br><span class="line">hello Linux 899</span><br><span class="line">hello Linux 990</span><br><span class="line">hello Linux 991</span><br><span class="line">hello Linux 992</span><br><span class="line">hello Linux 993</span><br><span class="line">hello Linux 994</span><br><span class="line">hello Linux 995</span><br><span class="line">hello Linux 996</span><br><span class="line">hello Linux 997</span><br><span class="line">hello Linux 998</span><br><span class="line">hello Linux 999</span><br></pre></td></tr></table></figure>

<p><code>grep</code> 指令是个行文本过滤工具，查找文件包含特定文本行的内容，并显示出来</p>
<ul>
<li><code>-i</code>：忽略大小写的不同，所以大小写视为相同</li>
<li><code>-n</code>：顺便输出行号</li>
<li><code>-v</code>：反向选择，亦即显示出没有 ‘搜寻字符串’ 内容的那一行</li>
</ul>
<h2 id="zip-unzip指令"><a href="#zip-unzip指令" class="headerlink" title="zip&#x2F;unzip指令"></a>zip&#x2F;unzip指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# zip Text.zip Text</span><br><span class="line">  adding: Text (deflated 86%)</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# tree</span><br><span class="line">.</span><br><span class="line">├── dir1</span><br><span class="line">│   ├── dir2</span><br><span class="line">│   │   └── dir3</span><br><span class="line">│   └── new_test</span><br><span class="line">├── my_dir</span><br><span class="line">│   ├── a1</span><br><span class="line">│   └── dir2</span><br><span class="line">│       └── dir3</span><br><span class="line">├── Text</span><br><span class="line">├── text1</span><br><span class="line">├── text2</span><br><span class="line">└── Text.zip</span><br></pre></td></tr></table></figure>

<p><code>zip</code> 命令用于压缩文件，若想要解压文件，可以输入 <code>unzip Text.zip</code>。由于服务器之间的差异，可能没有这两个指令，可以使用 <code>yum install -y zip unzip</code> 进行下载</p>
<ul>
<li><code>-r</code> 递归处理，将指定目录下的所有文件和子目录一并处理</li>
</ul>
<h2 id="tar指令"><a href="#tar指令" class="headerlink" title="tar指令"></a>tar指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# tar -czf code.tgz text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# ll</span><br><span class="line">total 36</span><br><span class="line">-rw-r--r-- 1 root     root       137 Jul  5 16:53 code.tgz</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test  4096 Jul  5 16:43 dir1</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test  4096 Jun 22 15:21 my_dir</span><br><span class="line">-rw-rw-r-- 1 root     root     15893 Jun 29 22:16 Text</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test    44 Jun 29 20:41 text1</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test     7 Jul  4 18:07 text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# <span class="built_in">rm</span> -rf text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# ll</span><br><span class="line">total 32</span><br><span class="line">-rw-r--r-- 1 root     root       137 Jul  5 16:53 code.tgz</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test  4096 Jul  5 16:43 dir1</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test  4096 Jun 22 15:21 my_dir</span><br><span class="line">-rw-rw-r-- 1 root     root     15893 Jun 29 22:16 Text</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test    44 Jun 29 20:41 text1</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# tar -tzf code.tgz</span><br><span class="line">text2</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# tar -xzf code.tgz</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]# ll</span><br><span class="line">total 36</span><br><span class="line">-rw-r--r-- 1 root     root       137 Jul  5 16:53 code.tgz</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test  4096 Jul  5 16:43 dir1</span><br><span class="line">drwxrwxr-x 3 zzh_test zzh_test  4096 Jun 22 15:21 my_dir</span><br><span class="line">-rw-rw-r-- 1 root     root     15893 Jun 29 22:16 Text</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test    44 Jun 29 20:41 text1</span><br><span class="line">-rw-rw-r-- 1 zzh_test zzh_test     7 Jul  4 18:07 text2</span><br></pre></td></tr></table></figure>

<p><code>tar</code> 是 <code>Linux</code> 环境里常用的压缩指令，比 <code>zip</code> 更实用，通常压缩为 <code>tar.gz</code> 格式（简写为 <code>tgz</code> ），<code>tar</code> 不能压缩为 <code>zip</code>，常用选项为 <code>-czf</code>（<code>creat zip file</code> 创建压缩文件），<code>-tzf</code>（查看压缩文件），<code>-xzf</code>（解压压缩文件）</p>
<ul>
<li><code>-c</code>：建立一个压缩文件的参数指令</li>
<li><code>-x</code>：解开一个压缩文件的参数指令</li>
<li><code>-t</code>：查看 <code>tarfile</code> 里面的文件</li>
<li><code>-z</code>：是否同时具有 <code>gzip</code> 的属性？亦即是否需要用 <code>gzip</code> 压缩？</li>
<li><code>-j</code>：是否同时具有 <code>bzip2</code> 的属性？亦即是否需要用 <code>bzip2</code> 压缩？</li>
<li><code>-v</code>：压缩的过程中显示文件！这个常用，但不建议用在背景执行过程！</li>
<li><code>-f</code>：使用档名，请留意，在 <code>f</code> 之后要立即接档名喔！不要再加参数！</li>
<li><code>-C</code>： 解压到指定目录</li>
</ul>
<h2 id="bc指令"><a href="#bc指令" class="headerlink" title="bc指令"></a>bc指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ bc</span><br><span class="line">bc 1.06.95</span><br><span class="line">Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.</span><br><span class="line">This is free software with ABSOLUTELY NO WARRANTY.</span><br><span class="line">For details <span class="built_in">type</span> `warranty<span class="string">&#x27;. </span></span><br><span class="line"><span class="string">5 + 3 * 2</span></span><br><span class="line"><span class="string">11</span></span><br><span class="line"><span class="string">scale=3    # 设置小数位数为3</span></span><br><span class="line"><span class="string">10 / 3 </span></span><br><span class="line"><span class="string">3.333</span></span><br><span class="line"><span class="string">quit       # 退出交互模式</span></span><br></pre></td></tr></table></figure>

<p>直接使用bc指令进入交互模式进行计算</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> <span class="string">&quot;sqrt(25)&quot;</span> | bc -l  <span class="comment"># 计算平方根，输出 5.0000000000</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;sin(3.14159/2)&quot;</span> | bc -l  <span class="comment"># 计算正弦值（弧度），约等于 1.000000</span></span><br></pre></td></tr></table></figure>

<p>也可以用 <code>echo</code> 传递表达式给 <code>bc</code> 在非交互模式下进行计算，<code>-l</code> 表示调用数学库进行计算</p>
<h2 id="uname指令"><a href="#uname指令" class="headerlink" title="uname指令"></a>uname指令</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">uname</span> -r</span><br><span class="line">3.10.0-1160.119.1.el7.x86_64</span><br><span class="line">[zzh_test@hcss-ecs-6aa4 ~]$ <span class="built_in">uname</span> -a</span><br><span class="line">Linux hcss-ecs-6aa4 3.10.0-1160.119.1.el7.x86_64 <span class="comment">#1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux</span></span><br></pre></td></tr></table></figure>

<p><code>uname -r</code> 用来获取电脑和操作系统的相关信息，<code>-a</code> 或 <code>–all</code> 详细输出所有信息，依次为内核名称，主机名，内核版本号，内核版本，硬件名，处理器类型，硬件平台类型，操作系统名称</p>
<h2 id="shutdown指令"><a href="#shutdown指令" class="headerlink" title="shutdown指令"></a>shutdown指令</h2><p>关机指令</p>
<ul>
<li><code>-h</code>：将系统的服务停掉后，立即关机</li>
<li><code>-r</code>：在将系统的服务停掉之后就重新启动</li>
<li><code>-t sec</code>：<code>-t</code> 后面加秒数，即过几秒后关机的意思</li>
</ul>
<h1 id="常用快捷键"><a href="#常用快捷键" class="headerlink" title="常用快捷键"></a>常用快捷键</h1><ul>
<li><code>[Tab]</code> 按键：具有命令补全和档案补齐的功能</li>
<li><code>[Ctrl]-c</code> 按键：让当前的程序停掉</li>
<li><code>[Ctrl]-d</code> 按键：通常代表着键盘输入结束(<code>End Of File</code>, <code>EOF</code> 戒 <code>End OfInput</code>)的意思；另外，他也可以用来取代 <code>exit</code></li>
<li><code>[Ctrl]-r</code> 按键：搜索历史命令，也可以用 <code>history</code> 指令查看，通常只保存最新的 <code>1000</code> 条指令</li>
</ul>
<hr>
<h1 id="希望读者们多多三连支持"><a href="#希望读者们多多三连支持" class="headerlink" title="希望读者们多多三连支持"></a>希望读者们多多三连支持</h1><h1 id="小编会继续更新"><a href="#小编会继续更新" class="headerlink" title="小编会继续更新"></a>小编会继续更新</h1><h1 id="你们的鼓励就是我前进的动力！"><a href="#你们的鼓励就是我前进的动力！" class="headerlink" title="你们的鼓励就是我前进的动力！"></a>你们的鼓励就是我前进的动力！</h1><p><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/3447c05d10e3425bb81264c8708dd174.jpg" alt="在这里插入图片描述"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="http://example.com">澪贰</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2025/07/07/Linux/Linux%E5%9F%BA%E6%9C%AC%E6%8C%87%E4%BB%A4/">http://example.com/2025/07/07/Linux/Linux基本指令/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来源 <a href="http://example.com" target="_blank">澪贰</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Linux/">Linux</a><a class="post-meta__tags" href="/tags/%E8%BF%90%E7%BB%B4/">运维</a><a class="post-meta__tags" href="/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/">服务器</a></div><div class="post-share"><div class="social-share" data-image="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250705182234.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i>赞助</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/Wechat.png" target="_blank"><img class="post-qr-code-img" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/Wechat.png" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/Alipay.png" target="_blank"><img class="post-qr-code-img" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/Alipay.png" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><a class="pagination-related" href="/2025/07/14/Linux/Linux%E6%9D%83%E9%99%90/" title="【Linux操作系统】简学深悟启示录：Linux权限"><img class="cover" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250713233449.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="info"><div class="info-1"><div class="info-item-1">上一篇</div><div class="info-item-2">【Linux操作系统】简学深悟启示录：Linux权限</div></div><div class="info-2"><div class="info-item-1">Linux 权限是系统通过对文件 &#x2F; 目录设置读（r）、写（w）、执行（x）权限，分别管控文件所有者、所属组及其他用户对其的访问操作，以保障系统安全 shell的运行原理 对于 Linux 来说，我们输入的命令行本质上就是在输入字符串，指令的本质就是调用在特定路径下存放的可执行文件，所有的指令最终都要在 OS（操作系统）内执行，但是 OS 的使用难度比较高，用户一般很难直接使用 OS 和他打交道，所以在用户输入的指令和 OS 之间设置了一层命令行解释器 命令行解释器会将命令翻译给核心（kernel）处理，同时将翻译后的结果给到使用者 存在的意义：  进行命令行解释  保护 OS，对于用户的非法请求直接拦截，起到过滤器的效果  用户的分类 用户一般分为：  root：超级用户 普通用户：我们新建的用户，即 adduser  由于某些情况下，比如下载依赖的时候就需要切换到 root 账号才能下载，可以使用 su 指令进行切换 超级用户的命令提示符是 #，普通用户的命令提示符是 $ 用户的切换 root用户切换普通用户  12[root@hcss-ecs-6aa4 ~]#...</div></div></div></a><a class="pagination-related" href="/2025/06/23/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/css%EF%BC%88%E4%B8%8B%EF%BC%89/" title="【前端基础】层叠宇宙的代码旅人：css（下）"><img class="cover" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250608235413.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="info text-right"><div class="info-1"><div class="info-item-1">下一篇</div><div class="info-item-2">【前端基础】层叠宇宙的代码旅人：css（下）</div></div><div class="info-2"><div class="info-item-1">本篇是 css 最后的布局优化 元素的显示模式块级元素✏️举个例子： 1234567h1 - h6pdivulolli... 特点:  独占一行 高度宽度，内外边距，行高都可以控制.  宽度默认是父级元素宽度的 100% (和父元素一样宽) 是一个容器(盒子)，里面可以放行内和块级元素  🔥值得注意的是：  文字类的元素内不能使用块级元素，p 标签主要用于存放文字，内部不能放块级元素，尤其是 div 行内元素✏️举个例子： 1234567891011astrongbemidelsinsuspan...  特点:  不独占一行，一行可以显示多个 设置高度，宽度，行高无效 左右外边距有效(上下无效)，内边距有效 默认宽度就是本身的内容 行内元素只能容纳文本和其他行内元素，不能放块级元素  🔥值得注意的是：  a 标签中不能再放 a 标签 (虽然 chrome 不报错，但是最好不要这么做)，a 标签里可以放块级元素，但是更建议先把 a...</div></div></div></a></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><a class="pagination-related" href="/2025/07/14/Linux/Linux%E6%9D%83%E9%99%90/" title="【Linux操作系统】简学深悟启示录：Linux权限"><img class="cover" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250713233449.jpg" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 2025-07-14</div><div class="info-item-2">【Linux操作系统】简学深悟启示录：Linux权限</div></div><div class="info-2"><div class="info-item-1">Linux 权限是系统通过对文件 &#x2F; 目录设置读（r）、写（w）、执行（x）权限，分别管控文件所有者、所属组及其他用户对其的访问操作，以保障系统安全 shell的运行原理 对于 Linux 来说，我们输入的命令行本质上就是在输入字符串，指令的本质就是调用在特定路径下存放的可执行文件，所有的指令最终都要在 OS（操作系统）内执行，但是 OS 的使用难度比较高，用户一般很难直接使用 OS 和他打交道，所以在用户输入的指令和 OS 之间设置了一层命令行解释器 命令行解释器会将命令翻译给核心（kernel）处理，同时将翻译后的结果给到使用者 存在的意义：  进行命令行解释  保护 OS，对于用户的非法请求直接拦截，起到过滤器的效果  用户的分类 用户一般分为：  root：超级用户 普通用户：我们新建的用户，即 adduser  由于某些情况下，比如下载依赖的时候就需要切换到 root 账号才能下载，可以使用 su 指令进行切换 超级用户的命令提示符是 #，普通用户的命令提示符是 $ 用户的切换 root用户切换普通用户  12[root@hcss-ecs-6aa4 ~]#...</div></div></div></a><a class="pagination-related" href="/2025/07/28/Linux/Linux%E7%8E%AF%E5%A2%83%E5%9F%BA%E7%A1%80%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8/" title="【Linux操作系统】简学深悟启示录：Linux环境基础开发工具使用"><img class="cover" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250728114434.jpg" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 2025-07-28</div><div class="info-item-2">【Linux操作系统】简学深悟启示录：Linux环境基础开发工具使用</div></div><div class="info-2"><div class="info-item-1">本文将介绍关于Linux系统常用的工具包，便于后续的代码操作 软件包管理器yum对于 Linux 系统来说，下载软件是必不可少的，就像平常使用手机下载软件一样满足我们的日常需求，一般 Linux 有三种下载方式：  源代码下载： 从官网下载代码自行配置，虽说可以充分利用代码自行调配，但是上手使用难度太高 rpm下载： 使用命令获取文件安装，但是会涉及该安装包依赖于其他安装包等问题，需要手动解决，过程繁琐 yum下载： 也是使用命令获取文件安装，能够自动分析软件包的依赖关系，并从 yum 源中下载并安装所需的依赖包，大大简化了软件安装过程，虽说安装的版本可能不是最新的，但是简单易上手，通常来说是够用的  因此我们主要使用 yum 🤔那么yum是如何下载的呢？ 其实也没那么复杂，就拿手机来举例，跟 Linux 系统一样都叫做客户端，yum 就相当于是手机里的应用市场，是一个软件的仓库地址，告诉 yum 去哪里找软件，然后通过网络在服务器里找到对应的软件源来下载软件包，软件源又分为官方和第三方的  通常我们通过 yum list 查看可安装软件列表，或者 yum search...</div></div></div></a><a class="pagination-related" href="/2025/01/31/%E8%AF%9D%E9%A2%98/%E6%9C%AC%E5%9C%B0%E9%83%A8%E7%BD%B2Deepseek/" title="如何快速高效本地部署DeepseekR1大模型？保姆级教程 无惧隐私威胁"><img class="cover" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/2373381f0feae7cd4964af546e9e462.png" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 2025-01-31</div><div class="info-item-2">如何快速高效本地部署DeepseekR1大模型？保姆级教程 无惧隐私威胁</div></div><div class="info-2"><div class="info-item-1">为什么要部署本地模型？DeepSeek 隐私政策中提到了关于用户输入信息收集的条款，无论你输入什么文本，以及上传什么文件都会被第三方机构所收集，所以如果是在进行相关的项目研究或者实验进展分析的时候，就很有必要对数据进行隐私保护，且本地部署是支持离线的  Ollama下载大模型不是一个双击就可以使用的.exe可执行文件，是需要平台来运行的一个东西，Ollama就是一个支持各种大模型本地部署的一个平台 ，用这个平台管理和大模型之间的输出和输入  首先浏览器中输入Ollama.com网址，选择第一个 然后点击这里的下载按钮 继续点击下载按钮，根据自己电脑的版本选择，我这里选择的是Windows系统  在浏览器右上角下载处等待下载完成  下载完后点击打开文件，弹出界面再点击Install下载，然后等待下载完成  Ollama在桌面上不会生成桌面图标，所以我们win+R打开运行窗口，输入cmd打开命令行  然后输入ollama...</div></div></div></a></div></div><hr class="custom-hr"/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info text-center"><div class="card-info-avatar"><div class="avatar-img"><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/zero_two.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-status-box"><div class="author-status"><g-emoji class="g-emoji" alias="palm_tree" fallback-src="https://lskypro.acozycotage.net/LightPicture/2022/12/fe1dc0402e623096.jpg">🤯</g-emoji><span>头脑风暴中</span></div></div></div><div class="author-info-name">澪贰</div><div class="author-info-description"></div><div class="site-data"><a href="/archives/"><div class="headline">文章</div><div class="length-num">96</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">74</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/ZeroCoder-Zhang"><i></i><span>🛫下一站--github</span></a><div class="card-info-social-icons"><a class="social-icon" href="https://github.com/ZeroCoder-Zhang" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:1478943685@qq.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content"><center><b>--- 主域名 ---<br><a target="_blank" rel="noopener" href="https://general.zzh-blog.club/" title="主域名链接" class="anno_content"><font color="#5ea6e5">general.zzh-blog.club</font></a></b></center><center><b>--- 推广学习交流(Wechat) ---<br><a target="_blank" rel="noopener" href="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/微信扫码加好友.png" title="微信图片" class="anno_content"><font color="#5ea6e5">zzh1478943685(备注来意)</font></a></b></center></div><div id="welcome-info"></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%EF%BC%9F"><span class="toc-number">1.</span> <span class="toc-text">什么是操作系统？</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Xshell%E7%9A%84%E4%BD%BF%E7%94%A8"><span class="toc-number">2.</span> <span class="toc-text">Xshell的使用</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4"><span class="toc-number">3.</span> <span class="toc-text">常用指令</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#ls%E6%8C%87%E4%BB%A4"><span class="toc-number">3.1.</span> <span class="toc-text">ls指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#pwd%E6%8C%87%E4%BB%A4"><span class="toc-number">3.2.</span> <span class="toc-text">pwd指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#cd%E6%8C%87%E4%BB%A4"><span class="toc-number">3.3.</span> <span class="toc-text">cd指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#touch%E6%8C%87%E4%BB%A4"><span class="toc-number">3.4.</span> <span class="toc-text">touch指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#mkdir%E6%8C%87%E4%BB%A4"><span class="toc-number">3.5.</span> <span class="toc-text">mkdir指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#rmdir%E6%8C%87%E4%BB%A4-rm%E6%8C%87%E4%BB%A4"><span class="toc-number">3.6.</span> <span class="toc-text">rmdir指令 &amp;&amp; rm指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#man%E6%8C%87%E4%BB%A4"><span class="toc-number">3.7.</span> <span class="toc-text">man指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#cp%E6%8C%87%E4%BB%A4"><span class="toc-number">3.8.</span> <span class="toc-text">cp指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#mv%E6%8C%87%E4%BB%A4"><span class="toc-number">3.9.</span> <span class="toc-text">mv指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#cat%E6%8C%87%E4%BB%A4"><span class="toc-number">3.10.</span> <span class="toc-text">cat指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#echo%E6%8C%87%E4%BB%A4%EF%BC%88%E9%87%8D%E5%AE%9A%E5%90%91%EF%BC%89"><span class="toc-number">3.11.</span> <span class="toc-text">echo指令（重定向）</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#more%E6%8C%87%E4%BB%A4"><span class="toc-number">3.12.</span> <span class="toc-text">more指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#less%E6%8C%87%E4%BB%A4"><span class="toc-number">3.13.</span> <span class="toc-text">less指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#head%E6%8C%87%E4%BB%A4"><span class="toc-number">3.14.</span> <span class="toc-text">head指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#tail%E6%8C%87%E4%BB%A4"><span class="toc-number">3.15.</span> <span class="toc-text">tail指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#date%E6%8C%87%E4%BB%A4"><span class="toc-number">3.16.</span> <span class="toc-text">date指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#cal%E6%8C%87%E4%BB%A4"><span class="toc-number">3.17.</span> <span class="toc-text">cal指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#find%E6%8C%87%E4%BB%A4"><span class="toc-number">3.18.</span> <span class="toc-text">find指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#grep%E6%8C%87%E4%BB%A4"><span class="toc-number">3.19.</span> <span class="toc-text">grep指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#zip-unzip%E6%8C%87%E4%BB%A4"><span class="toc-number">3.20.</span> <span class="toc-text">zip&#x2F;unzip指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#tar%E6%8C%87%E4%BB%A4"><span class="toc-number">3.21.</span> <span class="toc-text">tar指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#bc%E6%8C%87%E4%BB%A4"><span class="toc-number">3.22.</span> <span class="toc-text">bc指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#uname%E6%8C%87%E4%BB%A4"><span class="toc-number">3.23.</span> <span class="toc-text">uname指令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#shutdown%E6%8C%87%E4%BB%A4"><span class="toc-number">3.24.</span> <span class="toc-text">shutdown指令</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E5%BF%AB%E6%8D%B7%E9%94%AE"><span class="toc-number">4.</span> <span class="toc-text">常用快捷键</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B8%8C%E6%9C%9B%E8%AF%BB%E8%80%85%E4%BB%AC%E5%A4%9A%E5%A4%9A%E4%B8%89%E8%BF%9E%E6%94%AF%E6%8C%81"><span class="toc-number">5.</span> <span class="toc-text">希望读者们多多三连支持</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B0%8F%E7%BC%96%E4%BC%9A%E7%BB%A7%E7%BB%AD%E6%9B%B4%E6%96%B0"><span class="toc-number">6.</span> <span class="toc-text">小编会继续更新</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BD%A0%E4%BB%AC%E7%9A%84%E9%BC%93%E5%8A%B1%E5%B0%B1%E6%98%AF%E6%88%91%E5%89%8D%E8%BF%9B%E7%9A%84%E5%8A%A8%E5%8A%9B%EF%BC%81"><span class="toc-number">7.</span> <span class="toc-text">你们的鼓励就是我前进的动力！</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2025/07/28/Linux/Linux%E7%8E%AF%E5%A2%83%E5%9F%BA%E7%A1%80%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8/" title="【Linux操作系统】简学深悟启示录：Linux环境基础开发工具使用"><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250728114434.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="【Linux操作系统】简学深悟启示录：Linux环境基础开发工具使用"/></a><div class="content"><a class="title" href="/2025/07/28/Linux/Linux%E7%8E%AF%E5%A2%83%E5%9F%BA%E7%A1%80%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8/" title="【Linux操作系统】简学深悟启示录：Linux环境基础开发工具使用">【Linux操作系统】简学深悟启示录：Linux环境基础开发工具使用</a><time datetime="2025-07-28T13:41:39.000Z" title="发表于 2025-07-28 21:41:39">2025-07-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2025/07/14/Linux/Linux%E6%9D%83%E9%99%90/" title="【Linux操作系统】简学深悟启示录：Linux权限"><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250713233449.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="【Linux操作系统】简学深悟启示录：Linux权限"/></a><div class="content"><a class="title" href="/2025/07/14/Linux/Linux%E6%9D%83%E9%99%90/" title="【Linux操作系统】简学深悟启示录：Linux权限">【Linux操作系统】简学深悟启示录：Linux权限</a><time datetime="2025-07-13T22:00:00.000Z" title="发表于 2025-07-14 06:00:00">2025-07-14</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2025/07/07/Linux/Linux%E5%9F%BA%E6%9C%AC%E6%8C%87%E4%BB%A4/" title="【Linux操作系统】简学深悟启示录：Linux基本指令"><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250705182234.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="【Linux操作系统】简学深悟启示录：Linux基本指令"/></a><div class="content"><a class="title" href="/2025/07/07/Linux/Linux%E5%9F%BA%E6%9C%AC%E6%8C%87%E4%BB%A4/" title="【Linux操作系统】简学深悟启示录：Linux基本指令">【Linux操作系统】简学深悟启示录：Linux基本指令</a><time datetime="2025-07-07T12:31:51.000Z" title="发表于 2025-07-07 20:31:51">2025-07-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2025/06/23/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/css%EF%BC%88%E4%B8%8B%EF%BC%89/" title="【前端基础】层叠宇宙的代码旅人：css（下）"><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250608235413.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="【前端基础】层叠宇宙的代码旅人：css（下）"/></a><div class="content"><a class="title" href="/2025/06/23/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/css%EF%BC%88%E4%B8%8B%EF%BC%89/" title="【前端基础】层叠宇宙的代码旅人：css（下）">【前端基础】层叠宇宙的代码旅人：css（下）</a><time datetime="2025-06-23T07:47:50.000Z" title="发表于 2025-06-23 15:47:50">2025-06-23</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2025/06/23/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/css%EF%BC%88%E4%B8%AD%EF%BC%89/" title="【前端基础】层叠宇宙的代码旅人：css（中）"><img src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/909e58aa338befce9e0b2e4e683d50c.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="【前端基础】层叠宇宙的代码旅人：css（中）"/></a><div class="content"><a class="title" href="/2025/06/23/%E5%89%8D%E7%AB%AF%E5%9F%BA%E7%A1%80/css%EF%BC%88%E4%B8%AD%EF%BC%89/" title="【前端基础】层叠宇宙的代码旅人：css（中）">【前端基础】层叠宇宙的代码旅人：css（中）</a><time datetime="2025-06-23T07:44:20.000Z" title="发表于 2025-06-23 15:44:20">2025-06-23</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2024 - 2025 By 澪贰</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo 7.3.0</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly 5.3.5</a></div><div class="footer_custom_text">🏃‍➡️不是遇到同行伙伴再出发，而是出发后的路上遇到志同道合的人。<p></a>&nbsp;<a target="_blank" href="https://www.jsdelivr.com/"><img src= "" data-lazy-src="https://img.shields.io/badge/CDN-jsDelivr-orange?style=flat&logo=jsDelivr" title="本站使用JsDelivr为静态资源提供CDN加速"></a> &nbsp;<a target="_blank" href="https://vercel.com/ "><img src= "" data-lazy-src="https://img.shields.io/badge/Hosted-Vervel-brightgreen?style=flat&logo=Vercel" title="本站采用双线部署，默认线路托管于Vercel"></a>&nbsp;<a target="_blank" href="https://vercel.com/ "><img src= "" data-lazy-src="https://img.shields.io/badge/Hosted-Coding-0cedbe?style=flat&logo=Codio" title="本站采用双线部署，联通线路托管于Coding"></a>&nbsp;<a target="_blank" href="https://github.com/"><img src= "" data-lazy-src="https://img.shields.io/badge/Source-Github-d021d6?style=flat&logo=GitHub" title="本站项目由Gtihub托管"></a>&nbsp;<a target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img src= "" data-lazy-src="https://img.shields.io/badge/Copyright-BY--NC--SA%204.0-d42328?style=flat&logo=Claris" title="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可"></a></p></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="日间和夜间模式切换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="前往评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"><span id="percent">0</span><span>%</span></i></button><button id="go-down" type="button" title="直达底部" onclick="btf.scrollToDest(document.body.scrollHeight, 500)"><i class="fas fa-arrow-down"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"><script>(() => {
  const isShuoshuo = GLOBAL_CONFIG_SITE.pageType === 'shuoshuo'
  const option = null

  const getCount = () => {
    const countELement = document.getElementById('twikoo-count')
    if(!countELement) return
    twikoo.getCommentsCount({
      envId: 'https://twikoo.zzh-blog.club/',
      region: '',
      urls: [window.location.pathname],
      includeReply: false
    }).then(res => {
      countELement.textContent = res[0].count
    }).catch(err => {
      console.error(err)
    })
  }

  const init = (el = document, path = location.pathname) => {
    twikoo.init({
      el: el.querySelector('#twikoo-wrap'),
      envId: 'https://twikoo.zzh-blog.club/',
      region: '',
        placeholder: "|´・ω・)ノ嘿~都看到这儿了\n确定不评论一下再走嘛？\n(点完发送按钮等几秒哦~)",
        nicknamePlaceholder: "昵称/笔名",
        emailPlaceholder: "邮箱（不会公开）",
        urlPlaceholder: "个人站点",
      onCommentLoaded: () => {
        btf.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
      },
      ...option,
      path: isShuoshuo ? path : (option && option.path) || path
    })

    

    isShuoshuo && (window.shuoshuoComment.destroyTwikoo = () => {
      if (el.children.length) {
        el.innerHTML = ''
        el.classList.add('no-comment')
      }
    })
  }

  const loadTwikoo = (el, path) => {
    if (typeof twikoo === 'object') setTimeout(() => init(el, path), 0)
    else btf.getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(() => init(el, path))
  }

  if (isShuoshuo) {
    'Twikoo' === 'Twikoo'
      ? window.shuoshuoComment = { loadComment: loadTwikoo }
      : window.loadOtherComment = loadTwikoo
    return
  }

  if ('Twikoo' === 'Twikoo' || !true) {
    if (true) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
    else loadTwikoo()
  } else {
    window.loadOtherComment = loadTwikoo
  }
})()</script></div><script defer src="https://npm.elemecdn.com/jquery@latest/dist/jquery.min.js"></script><script defer data-pjax src="/js/cat.js"></script><canvas id="universe"></canvas><script defer src="/js/universe.js"></script><script async src="/js/title.js"></script><script async src="//npm.elemecdn.com/pace-js@1.2.4/pace.min.js"></script><script defer data-pjax src="/js/readPercent.js"></script><div class="aplayer no-destroy" data-id="8459282733" data-server="netease" data-type="playlist" data-fixed="true" data-autoplay="true" data-listmaxheight=400px data-order="random"> </div><script src="https://cdn.staticfile.org/jquery/3.6.3/jquery.min.js"></script><script async data-pjax src="/js/txmap.js"></script><script src="source/js/统计图颜色适配.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = false;
POWERMODE.mobile = true;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-heart.min.js" async="async" mobile="true"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/metingjs/dist/Meting.min.js"></script><script>(() => {
  const destroyAplayer = () => {
    if (window.aplayers) {
      for (let i = 0; i < window.aplayers.length; i++) {
        if (!window.aplayers[i].options.fixed) {
          window.aplayers[i].destroy()
        }
      }
    }
  }

  const runMetingJS = () => {
    typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
  }

  btf.addGlobalFn('pjaxSend', destroyAplayer, 'destroyAplayer')
  btf.addGlobalFn('pjaxComplete', loadMeting, 'runMetingJS')
})()</script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>(() => {
  const pjaxSelectors = ["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

  window.pjax = new Pjax({
    elements: 'a:not([target="_blank"])',
    selectors: pjaxSelectors,
    cacheBust: false,
    analytics: false,
    scrollRestoration: false
  })

  const triggerPjaxFn = (val) => {
    if (!val) return
    Object.values(val).forEach(fn => fn())
  }

  document.addEventListener('pjax:send', () => {
    // removeEventListener
    btf.removeGlobalFnEvent('pjaxSendOnce')
    btf.removeGlobalFnEvent('themeChange')

    // reset readmode
    const $bodyClassList = document.body.classList
    if ($bodyClassList.contains('read-mode')) $bodyClassList.remove('read-mode')

    triggerPjaxFn(window.globalFn.pjaxSend)
  })

  document.addEventListener('pjax:complete', () => {
    btf.removeGlobalFnEvent('pjaxCompleteOnce')
    document.querySelectorAll('script[data-pjax]').forEach(item => {
      const newScript = document.createElement('script')
      const content = item.text || item.textContent || item.innerHTML || ""
      Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
      newScript.appendChild(document.createTextNode(content))
      item.parentNode.replaceChild(newScript, item)
    })

    triggerPjaxFn(window.globalFn.pjaxComplete)
  })

  document.addEventListener('pjax:error', e => {
    if (e.request.status === 404) {
      const usePjax = true
      true 
        ? (usePjax ? pjax.loadUrl('/404.html') : window.location.href = '/404.html')
        : window.location.href = e.request.responseURL
    }
  })
})()</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="text-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="输入你想搜索的关键字" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div><!-- hexo injector body_end start --><script data-pjax>
    function butterfly_categories_card_injector_config(){
      var parent_div_git = document.getElementById('recent-posts');
      var item_html = '<style>li.categoryBar-list-item{width:24%;}.categoryBar-list{max-height: 380px;overflow:auto;}.categoryBar-list::-webkit-scrollbar{width:0!important}@media screen and (max-width: 650px){.categoryBar-list{max-height: 320px;}}</style><div class="recent-post-item" style="height:auto;width:100%;padding:0px;"><div id="categoryBar"><ul class="categoryBar-list"><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163139.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/Linux/&quot;);" href="javascript:void(0);">Linux</a><span class="categoryBar-list-count">3</span><span class="categoryBar-list-descr">C++笔记</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163140.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/C-初阶/&quot;);" href="javascript:void(0);">C++初阶</a><span class="categoryBar-list-count">19</span><span class="categoryBar-list-descr">C语言笔记</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_202507101631401.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/C语言/&quot;);" href="javascript:void(0);">C语言</a><span class="categoryBar-list-count">22</span><span class="categoryBar-list-descr">Linux笔记</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163130.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/Microi吾码/&quot;);" href="javascript:void(0);">Microi吾码</a><span class="categoryBar-list-count">2</span><span class="categoryBar-list-descr">C++笔记</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163135.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/C-进阶/&quot;);" href="javascript:void(0);">C++进阶</a><span class="categoryBar-list-count">19</span><span class="categoryBar-list-descr">低代码</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163137.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/优选算法/&quot;);" href="javascript:void(0);">优选算法</a><span class="categoryBar-list-count">11</span><span class="categoryBar-list-descr">数据结构笔记</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163136.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/前端基础/&quot;);" href="javascript:void(0);">前端基础</a><span class="categoryBar-list-count">5</span><span class="categoryBar-list-descr">入门常用算法</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163132.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/话题/&quot;);" href="javascript:void(0);">话题</a><span class="categoryBar-list-count">5</span><span class="categoryBar-list-descr">前端基础笔记</span></li><li class="categoryBar-list-item" style="background:url(https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250710163134.png);"> <a class="categoryBar-list-link" onclick="pjax.loadUrl(&quot;categories/初阶数据结构/&quot;);" href="javascript:void(0);">初阶数据结构</a><span class="categoryBar-list-count">10</span><span class="categoryBar-list-descr">杂谈</span></li></ul></div></div>';
      console.log('已挂载butterfly_categories_card')
      parent_div_git.insertAdjacentHTML("afterbegin",item_html)
      }
    if( document.getElementById('recent-posts') && (location.pathname ==='/'|| '/' ==='all')){
    butterfly_categories_card_injector_config()
    }
  </script><script data-pjax>
  function butterfly_footer_beautify_injector_config(){
    var parent_div_git = document.getElementById('footer-wrap');
    var item_html = '<div id="workboard"></div><p id="ghbdages"><a class="github-badge" target="_blank" href="https://hexo.io/" style="margin-inline:5px" data-title="博客框架为Hexo" title=""><img src= "" data-lazy-src="https://img.shields.io/badge/Frame-Hexo-blue?style=flat&amp;logo=hexo" alt=""/></a><a class="github-badge" target="_blank" href="https://butterfly.js.org/" style="margin-inline:5px" data-title="主题使用Butterfly" title=""><img src= "" data-lazy-src="https://img.shields.io/badge/Theme-Butterfly-6513df?style=flat&amp;logo=bitdefender" alt=""/></a></p>';
    console.log('已挂载butterfly_footer_beautify')
    parent_div_git.insertAdjacentHTML("beforeend",item_html)
    }
  var elist = 'null'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_footer_beautify_injector_config();
  }
  else if (epage === cpage){
    butterfly_footer_beautify_injector_config();
  }
  </script><script async src="https://unpkg.zhimg.com/hexo-butterfly-footer-beautify@1.0.0/lib/runtime.min.js"></script><script data-pjax>
  function butterfly_swiper_injector_config(){
    var parent_div_git = document.getElementById('recent-posts');
    var item_html = '<div class="recent-post-item" style="height: auto;width: 100%"><div class="blog-slider swiper-container-fade swiper-container-horizontal" id="swiper_container"><div class="blog-slider__wrp swiper-wrapper" style="transition-duration: 0ms;"><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;2025/02/28/话题/DeepSeek、Grok 和 ChatGPT 对比分析/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/77c5921463a44f418828ae47de6671e5.webp" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-02-28</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;2025/02/28/话题/DeepSeek、Grok 和 ChatGPT 对比分析/&quot;);" href="javascript:void(0);" alt="">DeepSeek、Grok 和 ChatGPT 对比分析：从技术与应用场景的角度深入探讨</a><div class="blog-slider__text">在人工智能领域，随着技术的快速发展，不同的工具和框架不断涌现，为开发者提供了更多选择。DeepSeek、Grok 和 ChatGPT 作为三款备受关注的工具，每一款都有其独特的优势和适用场景。本文将从技术特点、应用场景以及实际案例分析的角度，对这三款工具进行对比，帮助读者更好地理解它们的区别和适用场景</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;2025/02/28/话题/DeepSeek、Grok 和 ChatGPT 对比分析/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;2025/02/20/话题/C++方向后端开发学习指南/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/44fa280c73e53024f749363207753e1.png" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-02-20</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;2025/02/20/话题/C++方向后端开发学习指南/&quot;);" href="javascript:void(0);" alt="">当前就业形势下C++方向后端开发学习指南</a><div class="blog-slider__text">在信息技术飞速发展的今天，后端开发成为了软件开发领域中极其重要的组成部分。对于很多程序员来说，C++仍然是一个强大且广泛应用的编程语言，尤其在后端开发中有着不可忽视的地位。本文将深入探讨C++方向后端开发的学习路线，分析当前就业形势下的职业方向选择，并结合图示和代码示例，帮助读者系统化地学习C++后端开发</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;2025/02/20/话题/C++方向后端开发学习指南/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;2025/02/20/话题/AIGC训练效率/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/419f4f95b11526f92f62fe38778d0a9.png" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-02-20</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;2025/02/20/话题/AIGC训练效率/&quot;);" href="javascript:void(0);" alt="">AIGC训练效率与模型优化的深入探讨</a><div class="blog-slider__text">人工智能领域的发展，人工智能生成内容（ [AIGC](https://aigc.izzi.cn/)）越来越受关注。AIGC能够通过学习大量数据生成高质量内容，但训练效率和模型优化仍然是关键的研究方向。本博客将深入探AIGC的训练效率，与模型优化的相关策略和技术，提供相应代码示例和图示，以帮助读者更好地理解该领域</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;2025/02/20/话题/AIGC训练效率/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;2025/02/28/话题/如何高效利用DeepSeek/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/e640e59c2f92482993b52c845adf7844.webp" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-02-28</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;2025/02/28/话题/如何高效利用DeepSeek/&quot;);" href="javascript:void(0);" alt="">如何高效利用DeepSeek：深入探索AI搜索引擎的潜力</a><div class="blog-slider__text">随着人工智能技术的飞速发展，传统的搜索引擎正逐步向更智能化、个性化的方向演进。作为一款基于深度学习的AI搜索引擎，DeepSeek（深度求索）不仅在理解用户意图方面展现出色，还通过集成丰富的知识图谱和提供多样化的信息类型，成为现代用户的信息获取利器。本文将详细分析如何高效利用DeepSeek，探讨其核心技术、实际应用场景以及性能优化方法</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;2025/02/28/话题/如何高效利用DeepSeek/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;2025/01/31/话题/本地部署Deepseek/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://picture-bed000.oss-cn-shenzhen.aliyuncs.com/2373381f0feae7cd4964af546e9e462.png" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-01-31</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;2025/01/31/话题/本地部署Deepseek/&quot;);" href="javascript:void(0);" alt="">如何快速高效本地部署DeepseekR1大模型？保姆级教程 无惧隐私威胁</a><div class="blog-slider__text">DeepSeek 隐私政策中提到了关于用户输入信息收集的条款，无论你输入什么文本，以及上传什么文件都会被第三方机构所收集，所以如果是在进行相关的项目研究或者实验进展分析的时候，就很有必要对数据进行隐私保护，且本地部署是支持离线的</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;2025/01/31/话题/本地部署Deepseek/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div></div><div class="blog-slider__pagination swiper-pagination-clickable swiper-pagination-bullets"></div></div></div>';
    console.log('已挂载butterfly_swiper')
    parent_div_git.insertAdjacentHTML("afterbegin",item_html)
    }
  var elist = 'undefined'.split(',');
  var cpage = location.pathname;
  var epage = '/';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_swiper_injector_config();
  }
  else if (epage === cpage){
    butterfly_swiper_injector_config();
  }
  </script><script defer src="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.js"></script><script defer data-pjax src="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper_init.js"></script><script data-pjax src="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.js"></script><script data-pjax>
  function gitcalendar_injector_config(){
      var parent_div_git = document.getElementById('gitZone');
      var item_html = '<div class="recent-post-item" id="gitcalendarBar" style="width:100%;height:auto;padding:10px;"><style>#git_container{min-height: 280px}@media screen and (max-width:650px) {#git_container{min-height: 0px}}</style><div id="git_loading" style="width:10%;height:100%;margin:0 auto;display: block;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animatetransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animatetransform></path></svg><style>#git_container{display: none;}</style></div><div id="git_container"></div></div>';
      parent_div_git.insertAdjacentHTML("afterbegin",item_html)
      console.log('已挂载gitcalendar')
      }

    if( document.getElementById('gitZone') && (location.pathname ==='/about/'|| '/about/' ==='all')){
        gitcalendar_injector_config()
        GitCalendarInit("https://gitcalendar.zzh-blog.club/api?ZeroCoder-Zhang",['#d9e0df', '#c6e0dc', '#a8dcd4', '#9adcd2', '#89ded1', '#77e0d0', '#5fdecb', '#47dcc6', '#39dcc3', '#1fdabe', '#00dab9'],'ZeroCoder-Zhang')
    }
  </script><div class="js-pjax"><script async="async">var arr = document.getElementsByClassName('recent-post-item');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__zoomIn');
    arr[i].setAttribute('data-wow-duration', '2s');
    arr[i].setAttribute('data-wow-delay', '1s');
    arr[i].setAttribute('data-wow-offset', '100');
    arr[i].setAttribute('data-wow-iteration', '1');
  }</script><script async="async">var arr = document.getElementsByClassName('card-widget');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__zoomIn');
    arr[i].setAttribute('data-wow-duration', '');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script></div><script defer src="https://npm.elemecdn.com/hexo-butterfly-wowjs/lib/wow.min.js"></script><script defer src="https://npm.elemecdn.com/hexo-butterfly-wowjs/lib/wow_init.js"></script><!-- hexo injector body_end end --><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/koharu.model.json"},"display":{"position":"right","hOffset":40,"vOffset":0,"width":150,"height":300},"mobile":{"show":false},"log":false});</script></body></html>